package com.fsgom.common.web.view;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.fsgom.common.web.layout.LayoutHolder;

public class LayoutView extends AbstractTilesView {
	public static final String LAYOUT_URL_PREFIX = "layout:";

	public LayoutView(String viewName, String prefix, String suffix) {
		super(prefix + viewName.substring(LAYOUT_URL_PREFIX.length()) + suffix);
	}

	@Override
	protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
		renderMergedOutputModel(model, request, response, LayoutHolder.layout(), viewName);
	}
}